package com.pj.wisdomlogistics.ui.fragment;

import android.content.Intent;
import android.view.View;
import android.widget.Toast;

import com.pj.wisdomlogistics.R;
import com.pj.wisdomlogistics.cons.Cons;
import com.pj.wisdomlogistics.other.EventCenter;
import com.pj.wisdomlogistics.ui.activity.ApplyCarActivity;
import com.pj.wisdomlogistics.ui.activity.ApplyMealActivity;
import com.pj.wisdomlogistics.ui.activity.ChooseTakeoutActivity;
import com.pj.wisdomlogistics.ui.activity.MeetingChooseActivity;
import com.pj.wisdomlogistics.ui.activity.MyApplyActivity;
import com.pj.wisdomlogistics.ui.activity.MyTransactActivity;
import com.pj.wisdomlogistics.ui.activity.RepairActivity;
import com.pj.wisdomlogistics.ui.view.BadgerView;

import butterknife.BindView;
import butterknife.OnClick;



public class ApplyAccountFragment extends BaseFragment {
    @BindView(R.id.view_badger)
    BadgerView mBadgerView;

    @Override
    protected void initView() {
    }

    @Override
    protected void initData() {

    }

    @Override
    protected void onFirstUserVisible() {

    }

    @Override
    protected void onUserVisible() {

    }

    @Override
    protected void onUserInvisible() {

    }

    @Override
    public int getContentView() {
        return R.layout.fragment_apply_account;
    }

    @Override
    protected boolean isApplyEventBus() {
        return true;
    }

    @Override
    protected boolean isApplyButterKnife() {
        return true;
    }

    @Override
    protected void onEventCome(EventCenter eventCenter) {
        if(eventCenter.getEventCode() == Cons.Badger.BADGER_APPLY){
            mBadgerView.setMessageCount((Integer) eventCenter.getData());
        }
    }


    @OnClick({R.id.tv_apply, R.id.tv_apply_wmdc, R.id.tv_apply_whbx, R.id.tv_apply_ycsq,
            R.id.tv_apply_car, R.id.tv_apply_hys, R.id.tv_apply_wddb ,R.id.tv_apply_more})
    public void onViewClicked(View view) {
        //申请帐号
        switch (view.getId()) {
            case R.id.tv_apply:
                //我的申请
                startActivity(MyApplyActivity.class);
                break;
            case R.id.tv_apply_wmdc:
                //外卖点餐
                startActivity(ChooseTakeoutActivity.class);
                break;
            case R.id.tv_apply_whbx:
                //维护保修
                startActivity(RepairActivity.class);
                break;
            case R.id.tv_apply_ycsq:
                //用餐申请
                startActivity(ApplyMealActivity.class);
                break;
            case R.id.tv_apply_car:
                //用车申请
                startActivity(ApplyCarActivity.class);
                break;
            case R.id.tv_apply_hys:
                //会议室申请
                startActivity(MeetingChooseActivity.class);
                break;
            case R.id.tv_apply_wddb:
                //我的待办
                startActivity(MyTransactActivity.class);
                break;
            case R.id.tv_apply_more:
                //更多
                Toast.makeText(getContext(), "开发中。。。", Toast.LENGTH_SHORT).show();
                break;
        }
    }
}
